//将每个页面导入并取个名字
import React from 'react'
import ReactDom from 'react-dom'
import Log from './hrComponents/Log'
import Policy from './hrComponents/Policy'
import Home from './hrComponents/Home'
import Main from './hrComponents/Main'
import Import from './hrComponents/Import'
import Query from './hrComponents/Query'
import Record from './hrComponents/Record'
import Job from './hrComponents/Job'
import Me from './hrComponents/Me'
import ChangePwd from './hrComponents/ChangePwd'
import ChangePhone from './hrComponents/ChangePhone'
import Intro from './hrComponents/Intro'
import AddRP from './hrComponents/AddRP'
import AddBlack from './hrComponents/AddBlack'
import SetJob from './hrComponents/SetJob'
import { Router, Route, hashHistory, IndexRoute } from 'react-router'

// render就是渲染，将每个页面注册到HashHistory里面，比如在url里面输入http://localhost:8080/#/home就是主页面，
// 这里的#，因为选的hashHistory就会有的，我看网易云也有，应该没事的，或者再加几句配置一下改成browserHistory，总共有3种history，你们可以看看
// 这里有个嵌套的父子关系，IndexRoute。但是这里有些问题，/home和/home_main是一样的，因为一开始home只是左边栏+右边栏这些是不会变化的，
// 变化的只有中间的每次点击，查询信息，我的，记录等等的，变的只有中间部分。
// 但是一开始home中间必须得有东西，Home.js的地址是“/home”，Main.js的地址是“/home_main”，所以这两个显示的是一样的，
// 到时候看看能不能用强制redirect跳转换地址改，或者就这样。
ReactDom.render(
    <Router history={hashHistory}>
    <Route path="/policy" component={Policy}/>
    <Route path="/" component={Log}/>
        <Route path="/home" component={Home} >
            <IndexRoute component={Main}/>
            <Route path="/home_main_hr" component={Main}/>
            <Route path="/home_import_hr" component={Import}/>
            <Route path="/home_query_hr" component={Query}/>
            <Route path="/home_record_hr" component={Record}/>
            <Route path="/home_job_hr" component={Job}/>
            <Route path="/home_me_hr" component={Me}/>
            <Route path="/home_me_hr_changePwd" component={ChangePwd}/>
            <Route path="/home_me_hr_changePhone" component={ChangePhone}/>
            <Route path="/home_query_hr_intro" component={Intro}/>
            <Route path="/home_query_hr_setJob" component={SetJob}/>
            <Route path="/home_query_hr_addRP" component={AddRP}/>
            <Route path="/home_query_hr_addBlack" component={AddBlack}/>
        </Route>
    </Router>,
    document.getElementById('app')
);
